﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_CanTruCongNo : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvKhachHang")]
        private ADVObjects _AdvKhachHang;
        [AccessedThroughProperty("AdvTaiKhoanCo")]
        private ADVAccount _AdvTaiKhoanCo;
        [AccessedThroughProperty("AdvTaiKhoanNo")]
        private ADVAccount _AdvTaiKhoanNo;
        [AccessedThroughProperty("CboLoaiDuLieu")]
        private ComboBox _CboLoaiDuLieu;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdChuyen")]
        private Button _CmdChuyen;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdHelp")]
        private ToolStripButton _CmdHelp;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("cmdTimDonHang")]
        private Button _cmdTimDonHang;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("GroupBox2")]
        private GroupBox _GroupBox2;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label20")]
        private Label _Label20;
        [AccessedThroughProperty("Label21")]
        private Label _Label21;
        [AccessedThroughProperty("Label22")]
        private Label _Label22;
        [AccessedThroughProperty("Label23")]
        private Label _Label23;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("PNDungChung")]
        private Panel _PNDungChung;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtChietKhauNT")]
        private C1NumericEdit _TxtChietKhauNT;
        [AccessedThroughProperty("TxtConLai")]
        private C1NumericEdit _TxtConLai;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNgayDathang")]
        private DateTimePicker _TxtNgayDathang;
        [AccessedThroughProperty("TxtNgayHoaDon")]
        private DateTimePicker _TxtNgayHoaDon;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoHoaDon")]
        private TextBox _TxtSoHoaDon;
        [AccessedThroughProperty("TxtSoTienCanTru")]
        private C1NumericEdit _TxtSoTienCanTru;
        [AccessedThroughProperty("TxtSoXuatBan")]
        private TextBox _TxtSoXuatBan;
        [AccessedThroughProperty("TxtTienHangNT")]
        private C1NumericEdit _TxtTienHangNT;
        [AccessedThroughProperty("TxtTienThueNT")]
        private C1NumericEdit _TxtTienThueNT;
        [AccessedThroughProperty("TxtTongThanhToanNT")]
        private C1NumericEdit _TxtTongThanhToanNT;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        private string cFrmFormat;
        public string cFrmKhoa;
        public string cFrmKhoaHoaDon;
        private string cFrmKhoaOld;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsCanTruCongNo objCT;
        private clsXuatKho objHD;
        private clsSoChungTu objSoCT;

        public Frm_CanTruCongNo()
        {
            base.Load += new EventHandler(this.Frm_CanTruCongNo_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mLoaiChungTu = "CTCN";
            this.objSoCT = new clsSoChungTu();
            this.objHD = new clsXuatKho();
            this.objCT = new clsCanTruCongNo();
            this.InitializeComponent();
        }

        public bool CheckIvalid()
        {
            if (this.TxtSoChungTu.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số chứng từ!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.objCT.IsDuplicateVoucherNo(this.TxtSoChungTu.Text, this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ đ\x00e3 tồn tại, bạn phải nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.cFrmKhoaHoaDon, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn h\x00f3a đơn b\x00e1n h\x00e0ng!", ""));
                this.AdvTaiKhoanNo.Focus();
                return false;
            }
            if (this.AdvTaiKhoanNo.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập t\x00e0i khoản nợ!", ""));
                this.AdvTaiKhoanNo.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienCanTru.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số tiền cấn trừ!", ""));
                this.TxtSoTienCanTru.Focus();
                return false;
            }
            return true;
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.cFrmKhoa = modGeneral.CreatKey("GL_CanTruCongNo", 15, "CT");
            this.CboLoaiTien.SelectedValue = LVYModule.ReturnIfNull(modGeneral.H_CURRENCY, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            this.EnabledControl = true;
            this.TxtNgayChungTu.Focus();
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (((LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "") && LVYModule.ConfirmDelete("")) && this.objCT.Delete(this.cFrmKhoa))
            {
                this.EmptyData();
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.EnabledControl = true;
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_CanTruCongNoList.Dispose();
            MyProject.Forms.Frm_CanTruCongNoList.Show();
            MyProject.Forms.Frm_CanTruCongNoList.BringToFront();
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                clsCanTruCongNo objCT = this.objCT;
                objCT.Khoa = this.cFrmKhoa;
                objCT.SoChungTu = this.TxtSoChungTu.Text.Trim();
                objCT.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
                objCT.KhoaPhieuXuat = this.cFrmKhoaHoaDon;
                objCT.KhoaDoiTuong = this.AdvKhachHang.Value;
                objCT.LoaiTien = Conversions.ToString(this.CboLoaiTien.SelectedValue);
                objCT.TyGia = Conversions.ToDouble(this.txtTyGia.Value);
                objCT.KhoaTaiKhoanNo = this.AdvTaiKhoanNo.Value;
                objCT.KhoaTaiKhoanCo = this.AdvTaiKhoanCo.Value;
                objCT.SoTienCanTruNT = Conversions.ToDouble(this.TxtSoTienCanTru.Value);
                objCT.SoTienCanTru = objCT.SoTienCanTruNT * objCT.TyGia;
                objCT.SoTienConLaiNT = Conversions.ToDouble(this.TxtConLai.Value);
                objCT.SoTienConLai = objCT.SoTienConLaiNT * objCT.TyGia;
                objCT.DienGiai = this.TxtDienGiai.Text;
                objCT.KhoaDonVi = modGeneral.H_CLIENT;
                if (objCT.Save())
                {
                    objCT = null;
                    this.EnabledControl = false;
                }
            }
        }

        private void cmdTimDonHang_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_XuatBanList.objFrmCall = this;
            MyProject.Forms.Frm_XuatBanList.strConditions = " XK.Khoa NOT IN (SELECT KhoaPhieuXuat FROM GL_CanTruCongNo)";
            MyProject.Forms.Frm_XuatBanList.Show();
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoaOld, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.EmptyData();
            }
            else
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            this.EnabledControl = false;
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.TxtSoChungTu.Text = "";
            this.AdvTaiKhoanNo.Value = "";
            this.TxtDienGiai.Text = "";
            this.TxtSoTienCanTru.Value = 0;
            this.TxtConLai.Value = 0;
            this.TxtSoXuatBan.Text = "";
            this.cFrmKhoaHoaDon = "";
            this.CboLoaiTien.SelectedValue = "";
            this.txtTyGia.Value = 1;
            this.TxtSoHoaDon.Text = "";
            this.TxtTienHangNT.Value = 0;
            this.TxtChietKhauNT.Value = 0;
            this.TxtTienThueNT.Value = 0;
            this.TxtTongThanhToanNT.Value = 0;
            this.AdvKhachHang.Value = "";
            this.AdvTaiKhoanCo.Value = "";
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.txtTyGia, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienHangNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienThueNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTongThanhToanNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtChietKhauNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtSoTienCanTru, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtConLai, this.cFrmFormat);
        }

        private void Frm_CanTruCongNo_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                this.CmdAdd.Visible = true;
                if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    this.ShowData(this.cFrmKhoa);
                }
                else if (LVYModule.ReturnIfNull(this.cFrmKhoaHoaDon, "", modGeneral.TypeOfValue.Nothing).ToString() != "")
                {
                    this.InsertHoaDon(this.cFrmKhoaHoaDon);
                }
                this.FormatNumber();
                BuildComboModule.InitComboDatatype(this.CboLoaiDuLieu);
                this.PNDungChung.Visible = modGeneral.H_KETHOPDULIEUTHUE;
                this.EnabledControl = false;
                this.Cursor = Cursors.Default;
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_CanTruCongNo));
            this.GroupBox1 = new GroupBox();
            this.TxtNgayHoaDon = new DateTimePicker();
            this.Label12 = new Label();
            this.TxtSoHoaDon = new TextBox();
            this.Label8 = new Label();
            this.TxtTongThanhToanNT = new C1NumericEdit();
            this.Label23 = new Label();
            this.TxtTienThueNT = new C1NumericEdit();
            this.TxtTienHangNT = new C1NumericEdit();
            this.TxtChietKhauNT = new C1NumericEdit();
            this.Label22 = new Label();
            this.Label21 = new Label();
            this.Label5 = new Label();
            this.CboLoaiTien = new ComboBox();
            this.txtTyGia = new C1NumericEdit();
            this.Label11 = new Label();
            this.Label10 = new Label();
            this.Label16 = new Label();
            this.AdvKhachHang = new ADVObjects();
            this.cmdTimDonHang = new Button();
            this.Label4 = new Label();
            this.TxtNgayDathang = new DateTimePicker();
            this.Label6 = new Label();
            this.TxtSoXuatBan = new TextBox();
            this.GroupBox2 = new GroupBox();
            this.TxtConLai = new C1NumericEdit();
            this.Label7 = new Label();
            this.TxtSoTienCanTru = new C1NumericEdit();
            this.Label3 = new Label();
            this.TxtDienGiai = new TextBox();
            this.Label9 = new Label();
            this.Label20 = new Label();
            this.Label2 = new Label();
            this.AdvTaiKhoanCo = new ADVAccount();
            this.AdvTaiKhoanNo = new ADVAccount();
            this.Label13 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label1 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.ToolStrip1 = new ToolStrip();
            this.CmdAdd = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdFind = new ToolStripButton();
            this.CmdPrint = new ToolStripButton();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdExit = new ToolStripButton();
            this.CmdHelp = new ToolStripButton();
            this.PNDungChung = new Panel();
            this.CmdChuyen = new Button();
            this.CboLoaiDuLieu = new ComboBox();
            this.GroupBox1.SuspendLayout();
            ((ISupportInitialize) this.TxtTongThanhToanNT).BeginInit();
            ((ISupportInitialize) this.TxtTienThueNT).BeginInit();
            ((ISupportInitialize) this.TxtTienHangNT).BeginInit();
            ((ISupportInitialize) this.TxtChietKhauNT).BeginInit();
            ((ISupportInitialize) this.txtTyGia).BeginInit();
            this.GroupBox2.SuspendLayout();
            ((ISupportInitialize) this.TxtConLai).BeginInit();
            ((ISupportInitialize) this.TxtSoTienCanTru).BeginInit();
            this.ToolStrip1.SuspendLayout();
            this.PNDungChung.SuspendLayout();
            this.SuspendLayout();
            this.GroupBox1.Controls.Add(this.TxtNgayHoaDon);
            this.GroupBox1.Controls.Add(this.Label12);
            this.GroupBox1.Controls.Add(this.TxtSoHoaDon);
            this.GroupBox1.Controls.Add(this.Label8);
            this.GroupBox1.Controls.Add(this.TxtTongThanhToanNT);
            this.GroupBox1.Controls.Add(this.Label23);
            this.GroupBox1.Controls.Add(this.TxtTienThueNT);
            this.GroupBox1.Controls.Add(this.TxtTienHangNT);
            this.GroupBox1.Controls.Add(this.TxtChietKhauNT);
            this.GroupBox1.Controls.Add(this.Label22);
            this.GroupBox1.Controls.Add(this.Label21);
            this.GroupBox1.Controls.Add(this.Label5);
            this.GroupBox1.Controls.Add(this.CboLoaiTien);
            this.GroupBox1.Controls.Add(this.txtTyGia);
            this.GroupBox1.Controls.Add(this.Label11);
            this.GroupBox1.Controls.Add(this.Label10);
            this.GroupBox1.Controls.Add(this.Label16);
            this.GroupBox1.Controls.Add(this.AdvKhachHang);
            this.GroupBox1.Controls.Add(this.cmdTimDonHang);
            this.GroupBox1.Controls.Add(this.Label4);
            this.GroupBox1.Controls.Add(this.TxtNgayDathang);
            this.GroupBox1.Controls.Add(this.Label6);
            this.GroupBox1.Controls.Add(this.TxtSoXuatBan);
            Point point = new Point(8, 0x1d);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            Size size = new Size(650, 0x92);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 0x1c;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "H\x00f3a đơn b\x00e1n";
            this.TxtNgayHoaDon.Enabled = false;
            this.TxtNgayHoaDon.Format = DateTimePickerFormat.Custom;
            point = new Point(0x123, 0x61);
            this.TxtNgayHoaDon.Location = point;
            this.TxtNgayHoaDon.Name = "TxtNgayHoaDon";
            size = new Size(0x65, 20);
            this.TxtNgayHoaDon.Size = size;
            this.TxtNgayHoaDon.TabIndex = 0x9b;
            this.Label12.AutoSize = true;
            point = new Point(8, 0x65);
            this.Label12.Location = point;
            this.Label12.Name = "Label12";
            size = new Size(0x3f, 13);
            this.Label12.Size = size;
            this.Label12.TabIndex = 0x98;
            this.Label12.Text = "Số h\x00f3a đơn";
            point = new Point(100, 0x61);
            this.TxtSoHoaDon.Location = point;
            this.TxtSoHoaDon.Name = "TxtSoHoaDon";
            this.TxtSoHoaDon.ReadOnly = true;
            size = new Size(0x58, 20);
            this.TxtSoHoaDon.Size = size;
            this.TxtSoHoaDon.TabIndex = 0x99;
            this.Label8.AutoSize = true;
            point = new Point(0xde, 0x65);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            size = new Size(0x20, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x9a;
            this.Label8.Text = "Ng\x00e0y";
            this.TxtTongThanhToanNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhToanNT.DataType = typeof(double);
            this.TxtTongThanhToanNT.FormatType = FormatTypeEnum.CustomFormat;
            point = new Point(0x202, 0x61);
            this.TxtTongThanhToanNT.Location = point;
            this.TxtTongThanhToanNT.Name = "TxtTongThanhToanNT";
            Padding padding = new Padding(1);
            this.TxtTongThanhToanNT.Padding = padding;
            this.TxtTongThanhToanNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtTongThanhToanNT.Size = size;
            this.TxtTongThanhToanNT.TabIndex = 0x95;
            this.TxtTongThanhToanNT.Tag = null;
            this.TxtTongThanhToanNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhToanNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongThanhToanNT.VisualStyle = VisualStyle.Office2007Blue;
            this.TxtTongThanhToanNT.VisualStyleBaseStyle = VisualStyle.Office2007Blue;
            this.Label23.AutoSize = true;
            point = new Point(0x1a1, 0x65);
            this.Label23.Location = point;
            this.Label23.Name = "Label23";
            size = new Size(0x56, 13);
            this.Label23.Size = size;
            this.Label23.TabIndex = 0x94;
            this.Label23.Text = "Tổng thanh to\x00e1n";
            this.TxtTienThueNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienThueNT.DataType = typeof(double);
            this.TxtTienThueNT.FormatType = FormatTypeEnum.CustomFormat;
            point = new Point(0x202, 0x47);
            this.TxtTienThueNT.Location = point;
            this.TxtTienThueNT.Name = "TxtTienThueNT";
            padding = new Padding(1);
            this.TxtTienThueNT.Padding = padding;
            this.TxtTienThueNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtTienThueNT.Size = size;
            this.TxtTienThueNT.TabIndex = 0x97;
            this.TxtTienThueNT.Tag = null;
            this.TxtTienThueNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienThueNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienThueNT.VisualStyle = VisualStyle.Office2007Blue;
            this.TxtTienThueNT.VisualStyleBaseStyle = VisualStyle.Office2007Blue;
            this.TxtTienHangNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienHangNT.DataType = typeof(double);
            this.TxtTienHangNT.FormatType = FormatTypeEnum.CustomFormat;
            point = new Point(0x202, 20);
            this.TxtTienHangNT.Location = point;
            this.TxtTienHangNT.Name = "TxtTienHangNT";
            padding = new Padding(1);
            this.TxtTienHangNT.Padding = padding;
            this.TxtTienHangNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtTienHangNT.Size = size;
            this.TxtTienHangNT.TabIndex = 0x93;
            this.TxtTienHangNT.Tag = null;
            this.TxtTienHangNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienHangNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienHangNT.VisualStyle = VisualStyle.Office2007Blue;
            this.TxtTienHangNT.VisualStyleBaseStyle = VisualStyle.Office2007Blue;
            this.TxtChietKhauNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtChietKhauNT.DataType = typeof(double);
            this.TxtChietKhauNT.FormatType = FormatTypeEnum.CustomFormat;
            point = new Point(0x202, 0x2e);
            this.TxtChietKhauNT.Location = point;
            this.TxtChietKhauNT.Name = "TxtChietKhauNT";
            padding = new Padding(1);
            this.TxtChietKhauNT.Padding = padding;
            this.TxtChietKhauNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtChietKhauNT.Size = size;
            this.TxtChietKhauNT.TabIndex = 150;
            this.TxtChietKhauNT.Tag = null;
            this.TxtChietKhauNT.TextAlign = HorizontalAlignment.Right;
            this.TxtChietKhauNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtChietKhauNT.VisualStyle = VisualStyle.Office2007Blue;
            this.TxtChietKhauNT.VisualStyleBaseStyle = VisualStyle.Office2007Blue;
            this.Label22.AutoSize = true;
            point = new Point(0x1a1, 0x4b);
            this.Label22.Location = point;
            this.Label22.Name = "Label22";
            size = new Size(0x34, 13);
            this.Label22.Size = size;
            this.Label22.TabIndex = 0x92;
            this.Label22.Text = "Tiền thuế";
            this.Label21.AutoSize = true;
            point = new Point(0x1a1, 50);
            this.Label21.Location = point;
            this.Label21.Name = "Label21";
            size = new Size(0x51, 13);
            this.Label21.Size = size;
            this.Label21.TabIndex = 0x91;
            this.Label21.Text = "Tiền chiết khấu";
            this.Label5.AutoSize = true;
            point = new Point(0x1a1, 0x18);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x37, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x90;
            this.Label5.Text = "Tiền h\x00e0ng";
            this.CboLoaiTien.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiTien.Enabled = false;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(100, 0x47);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x58, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 0x6d;
            this.txtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this.txtTyGia.DataType = typeof(double);
            this.txtTyGia.Enabled = false;
            this.txtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x123, 0x47);
            this.txtTyGia.Location = point;
            this.txtTyGia.Name = "txtTyGia";
            padding = new Padding(1);
            this.txtTyGia.Padding = padding;
            size = new Size(0x65, 20);
            this.txtTyGia.Size = size;
            this.txtTyGia.TabIndex = 0x6f;
            this.txtTyGia.Tag = null;
            this.txtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.txtTyGia.VisualStyle = VisualStyle.Office2007Blue;
            this.txtTyGia.VisualStyleBaseStyle = VisualStyle.Office2007Blue;
            this.Label11.AutoSize = true;
            point = new Point(8, 0x4a);
            this.Label11.Location = point;
            this.Label11.Name = "Label11";
            size = new Size(0x2f, 13);
            this.Label11.Size = size;
            this.Label11.TabIndex = 0x6c;
            this.Label11.Text = "Loại tiền";
            this.Label11.TextAlign = ContentAlignment.TopRight;
            this.Label10.AutoSize = true;
            point = new Point(0xde, 0x4a);
            this.Label10.Location = point;
            this.Label10.Name = "Label10";
            size = new Size(0x24, 13);
            this.Label10.Size = size;
            this.Label10.TabIndex = 110;
            this.Label10.Text = "Tỷ gi\x00e1";
            this.Label10.TextAlign = ContentAlignment.TopRight;
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            point = new Point(8, 0x30);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            size = new Size(0x41, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 0x6a;
            this.Label16.Text = "Kh\x00e1ch h\x00e0ng";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            this.AdvKhachHang.Enabled = false;
            this.AdvKhachHang.LoaiDoiTuong = modGeneral.TypeObjects.KhachHang;
            point = new Point(100, 0x2d);
            this.AdvKhachHang.Location = point;
            this.AdvKhachHang.Name = "AdvKhachHang";
            this.AdvKhachHang.ReadOnly = false;
            size = new Size(0x124, 20);
            this.AdvKhachHang.Size = size;
            this.AdvKhachHang.TabIndex = 0x6b;
            this.AdvKhachHang.UpperText = true;
            this.AdvKhachHang.Value = "";
            this.AdvKhachHang.WidthCode = 80;
            this.cmdTimDonHang.BackgroundImage = ACCOUNTING.My.Resources.Resources.view;
            this.cmdTimDonHang.BackgroundImageLayout = ImageLayout.Stretch;
            point = new Point(0xbc, 0x12);
            this.cmdTimDonHang.Location = point;
            padding = new Padding(0);
            this.cmdTimDonHang.Margin = padding;
            this.cmdTimDonHang.Name = "cmdTimDonHang";
            size = new Size(0x17, 0x16);
            this.cmdTimDonHang.Size = size;
            this.cmdTimDonHang.TabIndex = 0x69;
            this.cmdTimDonHang.UseVisualStyleBackColor = true;
            this.Label4.AutoSize = true;
            point = new Point(0xde, 0x16);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x20, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x68;
            this.Label4.Text = "Ng\x00e0y";
            this.TxtNgayDathang.Enabled = false;
            this.TxtNgayDathang.Format = DateTimePickerFormat.Custom;
            point = new Point(0x123, 0x13);
            this.TxtNgayDathang.Location = point;
            this.TxtNgayDathang.Name = "TxtNgayDathang";
            size = new Size(0x65, 20);
            this.TxtNgayDathang.Size = size;
            this.TxtNgayDathang.TabIndex = 0x67;
            this.Label6.AutoSize = true;
            point = new Point(8, 0x16);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            size = new Size(0x44, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x66;
            this.Label6.Text = "Đơn h\x00e0ng số";
            this.TxtSoXuatBan.Enabled = false;
            point = new Point(100, 0x13);
            this.TxtSoXuatBan.Location = point;
            this.TxtSoXuatBan.Name = "TxtSoXuatBan";
            this.TxtSoXuatBan.ReadOnly = true;
            size = new Size(0x58, 20);
            this.TxtSoXuatBan.Size = size;
            this.TxtSoXuatBan.TabIndex = 0x65;
            this.GroupBox2.Controls.Add(this.PNDungChung);
            this.GroupBox2.Controls.Add(this.TxtConLai);
            this.GroupBox2.Controls.Add(this.Label7);
            this.GroupBox2.Controls.Add(this.TxtSoTienCanTru);
            this.GroupBox2.Controls.Add(this.Label3);
            this.GroupBox2.Controls.Add(this.TxtDienGiai);
            this.GroupBox2.Controls.Add(this.Label9);
            this.GroupBox2.Controls.Add(this.Label20);
            this.GroupBox2.Controls.Add(this.Label2);
            this.GroupBox2.Controls.Add(this.AdvTaiKhoanCo);
            this.GroupBox2.Controls.Add(this.AdvTaiKhoanNo);
            this.GroupBox2.Controls.Add(this.Label13);
            this.GroupBox2.Controls.Add(this.TxtNgayChungTu);
            this.GroupBox2.Controls.Add(this.Label1);
            this.GroupBox2.Controls.Add(this.TxtSoChungTu);
            point = new Point(8, 190);
            this.GroupBox2.Location = point;
            this.GroupBox2.Name = "GroupBox2";
            size = new Size(650, 0xa2);
            this.GroupBox2.Size = size;
            this.GroupBox2.TabIndex = 0x1d;
            this.GroupBox2.TabStop = false;
            this.GroupBox2.Text = "Chứng từ cấn trừ c\x00f4ng nợ";
            this.TxtConLai.BorderStyle = BorderStyle.FixedSingle;
            this.TxtConLai.DataType = typeof(double);
            this.TxtConLai.FormatType = FormatTypeEnum.CustomFormat;
            point = new Point(0x202, 0x37);
            this.TxtConLai.Location = point;
            this.TxtConLai.Name = "TxtConLai";
            padding = new Padding(1);
            this.TxtConLai.Padding = padding;
            this.TxtConLai.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtConLai.Size = size;
            this.TxtConLai.TabIndex = 0x97;
            this.TxtConLai.Tag = null;
            this.TxtConLai.TextAlign = HorizontalAlignment.Right;
            this.TxtConLai.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtConLai.VisualStyle = VisualStyle.Office2007Blue;
            this.TxtConLai.VisualStyleBaseStyle = VisualStyle.Office2007Blue;
            this.Label7.AutoSize = true;
            point = new Point(0x1a1, 0x3b);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x27, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 150;
            this.Label7.Text = "C\x00f2n lại";
            this.TxtSoTienCanTru.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTienCanTru.DataType = typeof(double);
            this.TxtSoTienCanTru.FormatType = FormatTypeEnum.CustomFormat;
            point = new Point(0x202, 0x1c);
            this.TxtSoTienCanTru.Location = point;
            this.TxtSoTienCanTru.Name = "TxtSoTienCanTru";
            padding = new Padding(1);
            this.TxtSoTienCanTru.Padding = padding;
            size = new Size(0x6d, 20);
            this.TxtSoTienCanTru.Size = size;
            this.TxtSoTienCanTru.TabIndex = 0x95;
            this.TxtSoTienCanTru.Tag = null;
            this.TxtSoTienCanTru.TextAlign = HorizontalAlignment.Right;
            this.TxtSoTienCanTru.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTienCanTru.VisualStyle = VisualStyle.Office2007Blue;
            this.TxtSoTienCanTru.VisualStyleBaseStyle = VisualStyle.Office2007Blue;
            this.Label3.AutoSize = true;
            point = new Point(0x1a1, 0x20);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x40, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x94;
            this.Label3.Text = "Tiền cấn trừ";
            point = new Point(100, 0x6c);
            this.TxtDienGiai.Location = point;
            this.TxtDienGiai.Name = "TxtDienGiai";
            size = new Size(0x20b, 20);
            this.TxtDienGiai.Size = size;
            this.TxtDienGiai.TabIndex = 0x2a;
            this.Label9.AutoEllipsis = true;
            this.Label9.AutoSize = true;
            point = new Point(8, 110);
            this.Label9.Location = point;
            this.Label9.Name = "Label9";
            this.Label9.RightToLeft = RightToLeft.No;
            size = new Size(0x30, 13);
            this.Label9.Size = size;
            this.Label9.TabIndex = 0x29;
            this.Label9.Text = "Diễn giải";
            this.Label9.TextAlign = ContentAlignment.TopRight;
            this.Label20.AutoSize = true;
            point = new Point(6, 0x55);
            this.Label20.Location = point;
            this.Label20.Name = "Label20";
            size = new Size(70, 13);
            this.Label20.Size = size;
            this.Label20.TabIndex = 0x27;
            this.Label20.Text = "T\x00e0i khoản c\x00f3";
            this.Label2.AutoSize = true;
            point = new Point(6, 0x3b);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(70, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x25;
            this.Label2.Text = "T\x00e0i khoản nợ";
            this.AdvTaiKhoanCo.Conditions = "";
            this.AdvTaiKhoanCo.DefaultValue = "";
            this.AdvTaiKhoanCo.Enabled = false;
            this.AdvTaiKhoanCo.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTaiKhoanCo.KeyFilter = "111|131|112";
            point = new Point(100, 0x51);
            this.AdvTaiKhoanCo.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoanCo.Margin = padding;
            this.AdvTaiKhoanCo.Name = "AdvTaiKhoanCo";
            this.AdvTaiKhoanCo.OnlyDigit = false;
            this.AdvTaiKhoanCo.ReadOnly = false;
            size = new Size(0x124, 20);
            this.AdvTaiKhoanCo.Size = size;
            this.AdvTaiKhoanCo.TabIndex = 40;
            this.AdvTaiKhoanCo.UpperText = true;
            this.AdvTaiKhoanCo.Value = "";
            this.AdvTaiKhoanCo.WithCode = 80;
            this.AdvTaiKhoanNo.Conditions = "";
            this.AdvTaiKhoanNo.DefaultValue = "";
            this.AdvTaiKhoanNo.FieldNameFilter = "Left(SoTaiKhoan,1)";
            this.AdvTaiKhoanNo.KeyFilter = "1|6|5";
            point = new Point(100, 0x37);
            this.AdvTaiKhoanNo.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoanNo.Margin = padding;
            this.AdvTaiKhoanNo.Name = "AdvTaiKhoanNo";
            this.AdvTaiKhoanNo.OnlyDigit = false;
            this.AdvTaiKhoanNo.ReadOnly = false;
            size = new Size(0x124, 20);
            this.AdvTaiKhoanNo.Size = size;
            this.AdvTaiKhoanNo.TabIndex = 0x26;
            this.AdvTaiKhoanNo.UpperText = true;
            this.AdvTaiKhoanNo.Value = "";
            this.AdvTaiKhoanNo.WithCode = 80;
            this.Label13.AutoSize = true;
            point = new Point(8, 0x1f);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x20, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 4;
            this.Label13.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Custom;
            point = new Point(100, 0x1c);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(0x58, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 5;
            this.Label1.AutoSize = true;
            point = new Point(0xd7, 0x1f);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x41, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 6;
            this.Label1.Text = "Số chứng từ";
            point = new Point(0x123, 0x1c);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x65, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 7;
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.ToolStripSeparator3, this.CmdExit, this.CmdHelp });
            point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(0x29b, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 0x1b;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x48, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2d, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x37, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x43, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x25, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.CmdPrint.Visible = false;
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2d, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x37, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdHelp.Alignment = ToolStripItemAlignment.Right;
            this.CmdHelp.Image = (Image) manager.GetObject("CmdHelp.Image");
            this.CmdHelp.ImageTransparentColor = Color.Magenta;
            this.CmdHelp.Name = "CmdHelp";
            size = new Size(0x30, 0x16);
            this.CmdHelp.Size = size;
            this.CmdHelp.Text = "&Help";
            this.PNDungChung.Controls.Add(this.CmdChuyen);
            this.PNDungChung.Controls.Add(this.CboLoaiDuLieu);
            point = new Point(0x157, 0x83);
            this.PNDungChung.Location = point;
            this.PNDungChung.Name = "PNDungChung";
            size = new Size(0x11f, 0x19);
            this.PNDungChung.Size = size;
            this.PNDungChung.TabIndex = 0x98;
            this.CmdChuyen.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            point = new Point(0x102, 1);
            this.CmdChuyen.Location = point;
            this.CmdChuyen.Name = "CmdChuyen";
            size = new Size(0x18, 0x17);
            this.CmdChuyen.Size = size;
            this.CmdChuyen.TabIndex = 15;
            this.CmdChuyen.Text = ">";
            this.CmdChuyen.UseVisualStyleBackColor = true;
            this.CboLoaiDuLieu.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiDuLieu.FormattingEnabled = true;
            point = new Point(0x5d, 2);
            this.CboLoaiDuLieu.Location = point;
            this.CboLoaiDuLieu.Name = "CboLoaiDuLieu";
            size = new Size(0xa4, 0x15);
            this.CboLoaiDuLieu.Size = size;
            this.CboLoaiDuLieu.TabIndex = 13;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x29b, 360);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.GroupBox2);
            this.Controls.Add(this.GroupBox1);
            this.Controls.Add(this.ToolStrip1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_CanTruCongNo";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BH-0011";
            this.Text = "CAN TRU CONG NO";
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            ((ISupportInitialize) this.TxtTongThanhToanNT).EndInit();
            ((ISupportInitialize) this.TxtTienThueNT).EndInit();
            ((ISupportInitialize) this.TxtTienHangNT).EndInit();
            ((ISupportInitialize) this.TxtChietKhauNT).EndInit();
            ((ISupportInitialize) this.txtTyGia).EndInit();
            this.GroupBox2.ResumeLayout(false);
            this.GroupBox2.PerformLayout();
            ((ISupportInitialize) this.TxtConLai).EndInit();
            ((ISupportInitialize) this.TxtSoTienCanTru).EndInit();
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            this.PNDungChung.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void InsertHoaDon(string strKhoaHoaDon)
        {
            this.objHD.Load(strKhoaHoaDon);
            this.TxtSoXuatBan.Text = this.objHD.SoChungTu;
            this.cFrmKhoaHoaDon = this.objHD.Khoa;
            this.TxtNgayDathang.Text = LVYModule.Char2Date(this.objHD.NgayChungTu);
            this.CboLoaiTien.SelectedValue = this.objHD.LoaiTien;
            this.txtTyGia.Value = this.objHD.TyGia;
            this.TxtSoHoaDon.Text = this.objHD.SoHoaDon;
            this.TxtNgayHoaDon.Text = LVYModule.Char2Date(this.objHD.NgayHoaDon);
            this.TxtTienHangNT.Value = this.objHD.TienHangNT;
            this.TxtChietKhauNT.Value = this.objHD.TienChietKhauNT;
            this.TxtTienThueNT.Value = this.objHD.TienThueVATNT;
            this.TxtTongThanhToanNT.Value = (this.objHD.TienHangNT - this.objHD.TienChietKhauNT) + this.objHD.TienThueVATNT;
            this.AdvKhachHang.Value = this.objHD.KhoaDoiTuong;
            this.AdvTaiKhoanCo.Value = this.objHD.KhoaTKThanhToan;
        }

        public void ShowData(string strKhoa)
        {
            this.objCT.Load(strKhoa);
            this.cFrmKhoa = strKhoa;
            this.InsertHoaDon(this.objCT.KhoaPhieuXuat);
            this.TxtDienGiai.Text = this.objCT.DienGiai;
            this.TxtSoTienCanTru.Value = this.objCT.SoTienCanTruNT;
            this.TxtConLai.Value = this.objCT.SoTienConLaiNT;
            this.TxtSoChungTu.Text = this.objCT.SoChungTu;
            this.TxtNgayChungTu.Text = LVYModule.Char2Date(this.objCT.NgayChungTu);
            this.AdvTaiKhoanNo.Value = this.objCT.KhoaTaiKhoanNo;
            this.AdvTaiKhoanCo.Value = this.objCT.KhoaTaiKhoanCo;
            this.CmdAdd.Visible = false;
        }

        private void TxtNgayChungTu_LostFocus(object sender, EventArgs e)
        {
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.TxtNgayHoaDon.Text = this.TxtNgayChungTu.Text;
        }

        private void TxtSoTienCanTru_LostFocus(object sender, EventArgs e)
        {
            double num2 = 0.0;
            double num = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienCanTru.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtConLai.Value = num2 - num;
        }

        internal virtual ADVObjects AdvKhachHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvKhachHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvKhachHang = value;
            }
        }

        internal virtual ADVAccount AdvTaiKhoanCo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanCo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanCo = value;
            }
        }

        internal virtual ADVAccount AdvTaiKhoanNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanNo = value;
            }
        }

        internal virtual ComboBox CboLoaiDuLieu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiDuLieu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiDuLieu = value;
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiTien = value;
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual Button CmdChuyen
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdChuyen;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdChuyen = value;
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdHelp
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdHelp;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdHelp = value;
            }
        }

        internal virtual ToolStripButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdPrint = value;
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual Button cmdTimDonHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._cmdTimDonHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.cmdTimDonHang_Click);
                if (this._cmdTimDonHang != null)
                {
                    this._cmdTimDonHang.Click -= handler;
                }
                this._cmdTimDonHang = value;
                if (this._cmdTimDonHang != null)
                {
                    this._cmdTimDonHang.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.AdvTaiKhoanNo.Enabled = value;
                this.TxtDienGiai.ReadOnly = !value;
                this.TxtSoTienCanTru.ReadOnly = !value;
                this.cmdTimDonHang.Enabled = value;
                this.CboLoaiDuLieu.Enabled = value;
                this.CmdChuyen.Enabled = !value;
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual GroupBox GroupBox2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox2 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label20
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label20;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label20 = value;
            }
        }

        internal virtual Label Label21
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label21;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label21 = value;
            }
        }

        internal virtual Label Label22
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label22;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label22 = value;
            }
        }

        internal virtual Label Label23
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label23;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label23 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual Panel PNDungChung
        {
            [DebuggerNonUserCode]
            get
            {
                return this._PNDungChung;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._PNDungChung = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual C1NumericEdit TxtChietKhauNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChietKhauNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChietKhauNT = value;
            }
        }

        internal virtual C1NumericEdit TxtConLai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtConLai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtConLai = value;
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtNgayChungTu_LostFocus);
                if (this._TxtNgayChungTu != null)
                {
                    this._TxtNgayChungTu.LostFocus -= handler;
                }
                this._TxtNgayChungTu = value;
                if (this._TxtNgayChungTu != null)
                {
                    this._TxtNgayChungTu.LostFocus += handler;
                }
            }
        }

        internal virtual DateTimePicker TxtNgayDathang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayDathang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayDathang = value;
            }
        }

        internal virtual DateTimePicker TxtNgayHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayHoaDon = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual TextBox TxtSoHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoHoaDon = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienCanTru
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienCanTru;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSoTienCanTru_LostFocus);
                if (this._TxtSoTienCanTru != null)
                {
                    this._TxtSoTienCanTru.LostFocus -= handler;
                }
                this._TxtSoTienCanTru = value;
                if (this._TxtSoTienCanTru != null)
                {
                    this._TxtSoTienCanTru.LostFocus += handler;
                }
            }
        }

        internal virtual TextBox TxtSoXuatBan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoXuatBan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoXuatBan = value;
            }
        }

        internal virtual C1NumericEdit TxtTienHangNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienHangNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienHangNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThueNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThueNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienThueNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToanNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToanNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToanNT = value;
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtTyGia = value;
            }
        }
    }
}

